In [1]:
%matplotlib inline
from ggplot import *

Look and Feel - Themes

Like everything else, you can apply a theme layer to your ggplots in order to make them look different. ggplot comes with 3 built in themes:

  • theme_gray (default)
  • theme_bw
  • theme_xkcd
  • theme_538

See examples below!


In [2]:
ggplot(diamonds, aes(x='price')) + geom_histogram()


Out[2]:
<ggplot: (284364709)>

In [3]:
ggplot(diamonds, aes(x='price')) + geom_histogram() + theme_gray()


Out[3]:
<ggplot: (285191613)>

In [4]:
ggplot(diamonds, aes(x='price')) + geom_histogram() + theme_bw()


Out[4]:
<ggplot: (285663657)>

In [5]:
ggplot(diamonds, aes(x='price')) + geom_histogram() + theme_xkcd()


Out[5]:
<ggplot: (285140085)>

In [6]:
ggplot(diamonds, aes(x='price')) + geom_histogram() + theme_538()


Out[6]:
<ggplot: (285606021)>

In [ ]: